<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>jQuery方式实现旋转.</title>
    <script type="text/javascript" src="./js/jquery-3.4.1.slim.min.js"></script>
    <script type="text/javascript" src="./js/JqueryRotate.js"></script>
    <style type="text/css">
        .second{
            width:300px;
            height:30px;
            background-color:red;
            position:fixed;
            left:500px;
            top:500px;
            /* transform:rotate(45deg); */
            /* transform-origin:0px 0px; */ /* CSS设置中心点，为左上角 */
        }
    </style>
    <script type="text/javascript">
        var degre = 0;
        function rotate(){
            degre += 10;
            var secDiv = document.getElementById("second");
            secDiv.style.transform = "rotate(" + degre + "deg)";
        }
        function rotate2(){
            degre += 10;
            $("#second").rotate({
                angle:degre,
                center:[0,0]
            });
        }
        function myload(){
            setInterval("rotate2()",1000);
        }
    </script>
</head>
<body onload="myload()">
    <div class="second" id="second"></div>
</body>
</html>